#include "uidesign.h"


uidesign::uidesign()
{

}
/*
setBtnQss(ui->btn1, "#34495E", "#FFFFFF", "#4E6D8C", "#F0F0F0", "#2D3E50", "#B8C6D1");

setBtnQss(ui->btn2, "#1ABC9C", "#E6F8F5", "#2EE1C1", "#FFFFFF", "#16A086", "#A7EEE6");

setBtnQss(ui->btn3, "#3498DB", "#FFFFFF", "#5DACE4", "#E5FEFF", "#2483C7", "#A0DAFB");

setBtnQss(ui->btn4, "#E74C3C", "#FFFFFF", "#EC7064", "#FFF5E7", "#DC2D1A", "#F5A996");
*/
void uidesign::setBtnQss(QPushButton *btn,QString normalColor, QString normalTextColor,QString hoverColor, QString hoverTextColor,QString pressedColor, QString pressedTextColor)
{
     QStringList qss;
     qss.append(QString("QPushButton{border-style:none;padding:10px;border-radius:5px;color:%1;background:%2;}").arg(normalTextColor).arg(normalColor));
     qss.append(QString("QPushButton:hover{color:%1;background:%2;}").arg(hoverTextColor).arg(hoverColor));
     qss.append(QString("QPushButton:pressed{color:%1;background:%2;}").arg(pressedTextColor).arg(pressedColor));
     btn->setStyleSheet(qss.join(""));
 }
/*
setTxtQss(ui->txt1, "#DCE4EC", "#34495E");

setTxtQss(ui->txt2, "#DCE4EC", "#1ABC9C");

setTxtQss(ui->txt3, "#DCE4EC", "#3498DB");

setTxtQss(ui->txt4, "#DCE4EC", "#E74C3C");*/
void uidesign::setTxtQss(QLineEdit *txt, QString normalColor, QString focusColor)

{
     QStringList qss;
     qss.append(QString("QLineEdit{border-style:none;padding:6px;border-radius:5px;border:2px solid %1;}").arg(normalColor));
     qss.append(QString("QLineEdit:focus{border:2px solid %1;}").arg(focusColor));
     txt->setStyleSheet(qss.join(""));

}
void uidesign::setTreeWidgetQss(QTreeWidget *treeWidget)
{
    QStringList qss;
    qss.append(QString("item {height:39px; margin:0px;padding:0px;"));
    qss.append(QString("show-decoration-selected:1;background-color: rgb(49, 58, 66);selection-background-color: rgb(49, 58, 66);color: rgb(255,255,255);"));
    qss.append(QString("selected {show-decoration-selected:1;selection-background-color: rgb(37, 44, 50);color: rgb(81,162,253);"));
    treeWidget->setStyleSheet(qss.join(""));
}
void uidesign::setLabelQss(QLabel *label,QString normalColor, QString focusColor)
{
    QStringList qss;
    qss.append(QString("QLabel{border-style:none;padding:6px;border-radius:5px;border:2px solid %1;background-color:rgb(255, 255, 255)}").arg(normalColor));
    qss.append(QString("QLabel:focus{border:2px solid %1;}").arg(focusColor));
    label->setStyleSheet(qss.join(""));
}
